﻿using System.Globalization;
using System.Windows.Data;

namespace Super.Hmi.Converters
{
    /// <summary>
    /// 一半转换器
    /// </summary>
    public class Double2To1Converter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is double v)
            {
                return v / 2;
            }
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
